function funp_genBtnByClass() {
	for (i=0;i<document.getElementsByTagName("div").length; i++) {
		if (document.getElementsByTagName("div").item(i).className == "funp_button"){
			var objDiv = document.getElementsByTagName("div").item(i);
			var url = objDiv.innerHTML;

            if (url.length ==0) url = "?url="+encodeURIComponent(document.URL);
            else url="?url="+encodeURIComponent(url);

            objDiv.innerHTML= '<iframe src="http://funp.com/tools/buttoniframe.php'+url+'" height="69" width="60" scrolling="no" frameborder="0" marginheight="0" marginwidth="0"></iframe>';
		}
	}
}

if (window.attachEvent) window.attachEvent('onload', funp_genBtnByClass);
else window.addEventListener('load', funp_genBtnByClass, false);

if (typeof BloggerExt != 'undefined') {
  if(typeof BloggerExt.registerHook == 'function') BloggerExt.registerHook(funp_genBtnByClass);
}